package practica02;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Eje01 {

	
	public static void main(String[] args) {
		int a;
		int b;
		int c;
		
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);		
		
		System.out.println("Ingrese un Numero:");
		
		try
		{
			a =Integer.parseInt( br.readLine());
		}
		catch (NumberFormatException ex) {
			a=0;
		}
		catch (IOException ex)
		{
			System.out.println("Error I/O.");
			a=0;
		}
		
		System.out.println("Ingrese un Numero:");
		
		try
		{
			b =Integer.parseInt( br.readLine());
		}
		catch (NumberFormatException ex) {
			b=0;
		}
		catch (IOException ex)
		{
			System.out.println("Error I/O.");
			b=0;
		}
		
		c=a+b;
		 
		StringBuilder texto = new StringBuilder();
		texto.append("El resultado de ");
		texto.append(Integer.toString(a));
		texto.append(" + ");
		texto.append(Integer.toString(b));
		texto.append(" = ");
		texto.append(Integer.toString(c));
		texto.append("\n");
		System.out.println(texto.toString());
		
	}

}
